//
//  LeftPageViewController.m
//  SunshineMusic
//
//  Created by dllo on 16/1/9.
//  Copyright © 2016年 G.Group. All rights reserved.
//

#import "LeftPageViewController.h"
#import <Masonry.h>
#define TABLEVIEW_BY_TOP 150

@interface LeftPageViewController () <UITableViewDataSource, UITableViewDelegate>

@end

@implementation LeftPageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self createSubViews];
}

- (void)createSubViews
{
    self.view.backgroundColor = [UIColor greenColor];
    [self createTableView];
}

- (void)createTableView
{
    self.tableV  = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
    self.tableV.backgroundColor = [UIColor greenColor];
    self.tableV.delegate = self;
    self.tableV.dataSource = self;
        [self.view addSubview:self.tableV];
        [self.tableV registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    [self.tableV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.topMargin.equalTo(self.view.mas_top).offset(TABLEVIEW_BY_TOP);
        make.width.bottom.equalTo(self.view);     
    }];


    [_tableV release];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 20;
}

// Row display. Implementers should *always* try to reuse cells by setting each cell's reuseIdentifier and querying for available reusable cells with dequeueReusableCellWithIdentifier:
// Cell gets various attributes set automatically based on table (separators) and data source (accessory views, editing controls)

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    cell.textLabel.text = @"余浩傻逼";
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
